package se.bluebrim.usb.example;

/**
 * 
 * @author Jeff Friesen
 *
 */
public abstract class Device
{
   /**
    *  Device's manufacturer. May be null.
    */

   public String manufacturer;

   /**
    *  Device's product name. May be null.
    */

   public String product;

   /**
    *  Device's serial number. May be null.
    */

   public String serialNumber;

   /**
    *  This convenience method tells you whether the current Device object is
    *  a Hub or a Function.
    *
    *  @return true if Hub; false if Function
    */

   public boolean isHub ()
   {
      return (this instanceof Hub) ? true : false;
   }

   /**
    *  Return a string representation of this object, which is actually a Hub
    *  or a Function.
    *
    *  @return string representation
    */

   public String toString ()
   {
      return isHub () ? "Hub" : "Function";
   }
}
